import request from '@UTILS/api/request'
import config from '@UTILS/config'
import store from 'store'
import MockData from '../../../mock/main'


MockData.init()

// var config = {
//     api: {
//         serviceUrl: store.get('data_url'),
//         kpiUrl: store.get('data_url') + '/kpi'
//     }
// }


export default {
    // 授权登录
    login: (params, opt) => {
        return request.post(config.api.serviceUrl + '/login', opt, params)
    },
    // 获取授权参数
    wechatAppid: (params, opt) => {
        return request.post(config.api.serviceUrl + '/wechat_appid', opt, params)
    },
    // 通过code换取网页授权access_token
    wechaGetAccessToken: (url, params, opt) => {
        return request.get(url, opt, params)
    },
    // 获取手机短信验证码
    phoneSendCode: (params, opt) => {
        return request.post(config.api.serviceUrl + '/login/phoneSendCode', opt, params)
    },
    // 订单发起支付
    paymentsIndex: (params, opt) => {
        return request.post(config.api.serviceUrl + '/payments/index', opt, params)
    },
    // 获取表单验证token
    getToken: (params, opt) => {
        return request.post(config.api.serviceUrl + '/logic/get_token', opt, params)
    },
    // 获取七牛token
    baseUploadImg: (params, opt) => {
        return request.post(config.api.serviceUrl + '/base_upload_img', opt, params)
    },



    // 获取已报名活动
    getActivity: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_activity', opt, params)
    },
    // 帮助中心
    getHelpCenter: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_help_center', opt, params)
    },
    // 核销码
    writeOff: (params, opt) => {
        return request.post(config.api.kpiUrl + '/write_off', opt, params)
    },
    // 获取活动报名信息
    getActUser: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_act_user', opt, params)
    },
    // 获取活动推广码
    poster: (params, opt) => {
        return request.post(config.api.kpiUrl + '/poster', opt, params)
    },
    // 获取活动直播间
    getLive: (params, opt) => {
        return request.post(config.api.kpiUrl + '/getLive', opt, params)
    },
    // 线下签单
    addOffLineOrder: (params, opt) => {
        return request.post(config.api.kpiUrl + '/add_off_line_order', opt, params)
    },
    // 随身码
    setCarryCode: (params, opt) => {
        return request.post(config.api.kpiUrl + '/set_carry_code', opt, params)
    },
    // 获取随身码详情
    getCarryCodeInfo: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_carry_code_info', opt, params)
    },
    // 获取随身码列表
    getCarryCode: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_carry_code', opt, params)
    },
    // 奖励豆配置参数注释
    rewardLlocation: (params, opt) => {
        return request.post(config.api.kpiUrl + '/reward_llocation', opt, params)
    },
    // 充值类型
    rechargeType: (params, opt) => {
        return request.post(config.api.kpiUrl + '/rechargeType', opt, params)
    },
    // 根据活动获取（战队）品牌
    getBrandList: (params, opt) => {
        return request.post(config.api.kpiUrl + '/getBrandList', opt, params)
    },
    // 根据活动门店列表
    getStoreList: (params, opt) => {
        return request.post(config.api.kpiUrl + '/getStoreList', opt, params)
    },
    // kpi注册申请
    addActivityForYuan: (params, opt) => {
        return request.post(config.api.kpiUrl + '/addActivityForYuan', opt, params)
    },
    // 逛店签到
    shopping: (params, opt) => {
        return request.post(config.api.kpiUrl + '/shopping', opt, params)
    },
    // 获取随身码二维码详情
    getCarryQrcode: (params, opt) => {
        return request.post(config.api.kpiUrl + '/get_carry_qrcode', opt, params)
    },
    // 工人绑定随身码
    bindingCarry: (params, opt) => {
        return request.post(config.api.kpiUrl + '/binding_carry', opt, params)
    },
    // 更新活动个人码
    setPersonalCode: (params, opt) => {
        return request.post(config.api.kpiUrl + '/setPersonalCode', opt, params)
    },
    // 获取活动个人码
    getPersonalCode: (params, opt) => {
        return request.post(config.api.kpiUrl + '/getPersonalCode', opt, params)
    },



    // 业绩
    getAchievement: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_achievement', opt, params)
    },
    // 业绩用户列表
    getAchievementMember: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_achievement_member', opt, params)
    },
    // 业主详情
    getUserOwnerInfo: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_user_owner_info', opt, params)
    },
    // 我的报名客户
    getCustomer: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_customer', opt, params)
    },
    // 我的报名客户详情
    getCustomerInfo: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_customer_info', opt, params)
    },
    // 我的报名客户详情 编辑
    editCustomer: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/edit_customer', opt, params)
    },
    // 奖励豆规则
    getRewardRules: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_reward_rules', opt, params)
    },
    // 奖励豆排行
    getBeansRanking: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_beans_ranking', opt, params)
    },
    // 奖励豆排行 品牌
    getBeansSRanking: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_beans_s_ranking', opt, params)
    },
    // 添加阶段
    setStage: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_stage', opt, params)
    },
    // 添加阶段时获取奖金池金额
    getStageMoney: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_stage_money', opt, params)
    },
    // 获取阶段
    getAllStage: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_all_stage', opt, params)
    },
    // 目标管理列表
    memberTarget: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/member_target', opt, params)
    },
    // 目标管理分配
    setMemberTarget: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_member_target', opt, params)
    },
    // 员工申请列表
    invitationList: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/invitation_list', opt, params)
    },
    // 业主查询
    getUserOwner: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_user_owner', opt, params)
    },
    // 排行个人 门店 战队
    getBrandRanking: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_brand_ranking', opt, params)
    },
    // 获取奖励豆设置
    getBonusBeans: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_bonus_beans', opt, params)
    },
    // 更新奖励豆设置
    setBonusBeans: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_bonus_beans', opt, params)
    },
    // 任务分配
    setBrandBonus: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_brand_bonus', opt, params)
    },
    // 任务分配获取奖励配置
    getBrandBonus: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_brand_bonus', opt, params)
    },
    // 战队pk 获取
    getBrandPk: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_brand_pk', opt, params)
    },
    // 战队pk 详情
    getBrandPkInfo: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_brand_pk_info', opt, params)
    },
    // 任务执行情况
    getTaskPerformance: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_task_performance', opt, params)
    },
    // 战队pk 分配
    setBrandPk: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_brand_pk', opt, params)
    },
    // 趋势分析 产品
    getGoodsTrend: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_goods_trend', opt, params)
    },
    // 品牌自动奖惩 获取
    brandsRewardPunishment: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/brands_reward_punishment', opt, params)
    },
    // 品牌手动奖惩 获取（根据战队获取个人）
    getBrandsMember: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_brands_member', opt, params)
    },
    // 员工审核是否通过
    invitationExamine: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/invitation_examine', opt, params)
    },
    // 员工邀请
    invitationStaff: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/invitation_staff', opt, params)
    },


    // 财务
    getMemberFinance: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/get_member_finance', opt, params)
    },
    // 财务 支出记录
    getMoneyExpend: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/get_money_expend', opt, params)
    },
    // 财务提现
    getOrderMoney: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/get_order_money', opt, params)
    },
    // 员工 品牌负责人充值 数据
    getStaffRecharge: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/get_staff_recharge', opt, params)
    },
    // 活动费用
    getActCost: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/get_act_cost', opt, params)
    },
    // 员工 品牌负责人充值 生成订单
    setStaffRecharge: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/set_staff_recharge', opt, params)
    },
    // 活动费用 充值
    actCostRecharge: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/act_cost_recharge', opt, params)
    },
    // 活动费用 财务提现结算
    setCostWithdrawal: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/set_cost_withdrawal', opt, params)
    },
    // 财务 提现
    setWithdrawal: (params, opt) => {
        return request.post(config.api.kpiUrl + '/finance/set_withdrawal', opt, params)
    },
    // 财务 提现
    setBrandsMember: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/set_brands_member', opt, params)
    },
    // 跳支付页面
    getPayUrl: (params, opt) => {
        return request.get(config.api.serviceUrl + '/get_pay_url', opt, params)
    },
    // 品牌自动奖惩 执行
    brandsRewardImplement: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/brands_reward_implement', opt, params)
    },
    // 获取活动奖励政策
    getPolicy: (params, opt) => {
        return request.post(config.api.kpiUrl + '/getPolicy', opt, params)
    },
    // 取授权地址
    getloginurl: (params, opt) => {
        return request.get(config.api.serviceUrl + '/get_login_url', opt, params)
    },
    // 业绩浏览记录
    getAchievementBrowse: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_achievement_browse', opt, params)
    },
    // 签单列表
    offLineOrder: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/off_line_order', opt, params)
    },
    // 签单详情
    getOffLineOrderInfo: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/get_off_line_order_info', opt, params)
    },
    // 趋势分析
    trend: (params, opt) => {
        return request.post(config.api.kpiUrl + '/member/trend', opt, params)
    },
}
